Search String

I need to write a script that creates traces to each requirement listed in an object. Multiple requirements will be listed in the object. How do I grab each of those requirements individually?
guti0201 - Sun Oct 24 17:24:13 EDT 2010

Re: Search String
llandale - Mon Oct 25 09:40:39 EDT 2010

First off, everyone agrees you should have one requirement per object. You cannot track 'requirements' when they are mixed with others in a paragraph. For one thing, how do you assign an ID?

This looks like a great time to use regular expressions. It also means you are going to have to come up with some rules governing how to distinquish multiple requirements in the same object.

I 'requirement' is a sentence containing 'shall'. Perhaps you want to add 'will'. Lets presume you have your requirements in sentances in the same paragraph. If each sentance contains 'shall' then its easy. But what do you do when some sentance contains no 'shall', and is surrounded with 'shall' sentances; to which requirement does it belong.

Bla bla shall bla.  Bli bli bli.  Blu shall blu 20 ms. blu.

Does the 'Bli' sentence belong with the 'Bla' or the 'Blu' requirement?


Your regexp must recongnize a 'sentance'. A 'sentance' starts with the start of the paragraph, ends with the end of the paragraph, and ends when a new sentance starts. The separator for two sentances is a period then white space (end of 1st sentance) followed by a word starting with a capital letter (start of 2nd sentance). This is one sentance:

 

The X shall support 25hz. frequency.

Your code will iterate sentances and join them together into 'requirements'.


I'm not very good with regular expressions, but good luck.

 

 

 

  • Louie

 

 

Re: Search String
Mathias Mamsch - Mon Oct 25 11:21:21 EDT 2010

I am pretty sure you do not want to reference your requirements by the requirement text, but you have some attribute in which the IDs are listed.

In this case you would first cache all target modules to a string skip list using the requirement identifier as a key and the object as the value. Then you will iterate all objects of your requirement module, split the identifiers by a regular expression (see DXL help example for regular expressions), find the target object in the cache and then make a link.

Hope this raw description will help.

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS